import request from '@/utils/request'

// 首页
export function crmFinanceIndex(data) {
  return request({
    url: 'finance/index',
    method: 'post',
    data: data
  })
}

// 未收款
export function crmNoFinanceIndex(data) {
  return request({
    url: 'finance/nofinance',
    method: 'post',
    data: data
  })
}

// 发票
export function crmInvoiceIndex(data) {
  return request({
    url: 'finance/invoiceindex',
    method: 'post',
    data: data
  })
}

// 费用申请
export function crmApplyIndex(data) {
  return request({
    url: 'finance/apply',
    method: 'post',
    data: data
  })
}

/**
 * 导出
 * @param {*} data
 * customer_id 客户ID
 */
export function crmFinanceExcelExport(data) {
  return request({
    url: 'finance/excelexport',
    method: 'post',
    data: data,
    responseType: 'blob',
    timeout: 600000
  })
}


// 删除
export function crmFinanceDel(data) {
  return request({
    url: 'finance/del_finance',
    method: 'post',
    data: data
  })
}

// 删除未收款
export function crmNoFinanceDel(data) {
  return request({
    url: 'finance/del_nofinance',
    method: 'post',
    data: data
  })
}

// 删除发票
export function crmInvoiceDel(data) {
  return request({
    url: 'finance/del_invoice',
    method: 'post',
    data: data
  })
}